<?php

require_once 'Zend/View/Helper/Abstract.php';

class  Core_View_Helper_Admin_CurrentAdminUser extends Zend_View_Helper_Abstract
{
    /**
     * comments
     */
    public function currentAdminUser($id = 'currentUser')
    {
        $u = new Model_User();
        $user = $u->getCurrentUser();
        if (isset($user) && Model_Group::GUEST_ROLE != $user->name) {
            $xhtml = '<ul id="' . $id . '">'
                   . '<li title="' . $user->first_name . ' ' . $user->last_name . '">'
                   . '    ' . $this->view->getTranslation('Current User') . ': ' . $user->name
                   . '</li>'
                   . '<li>' . $this->view->getTranslation('Role') . ': ' . $user->role . '</li>'
                   . '<li><a href="' . $this->view->getBaseUrl() . '/admin/auth/logout/">' . $this->view->getTranslation('Log Out') . '</a></li>'
                   . '</ul>';
            return $xhtml;
        }
        return false;
    }
}